using PureMVC.Interfaces;
using UnityEngine;
using WooEngine.Common;
using WooEngine.NetWork;
using WooEngine.NetWork.Provider;

public class CSNetGateWayGetCenterInfoCommand : AbstractSimpleCommand
{
    public const string DefaultClassName = "/gate/goto/getCenterInfo";
    public override void Execute(INotification notification)
    {
        base.Execute(notification);

        CSNetGetGameCenterBean netGetGameCenterBean = new CSNetGetGameCenterBean();
        netGetGameCenterBean.version = "0.1.0";
        netGetGameCenterBean.platform = "android";
        netGetGameCenterBean.channel = "xzh";
        string json = JsonUtility.ToJson(netGetGameCenterBean);
#if NET_REMOTE_TEST
    HttpProvider gateWayProvider = NetWorkManager.Instance.CreateProvider<HttpProvider>("GWServ", "dev.gate.xzhjoy.com", "80");
#elif NET_LOCAL_LX
    HttpProvider gateWayProvider = NetWorkManager.Instance.CreateProvider<HttpProvider>("GWServ", "192.168.126.52", "8080");
#else
        HttpProvider gateWayProvider = NetWorkManager.Instance.CreateProvider<HttpProvider>("GWServ", "192.168.126.71", "8080");
#endif
        gateWayProvider.Connect();
        gateWayProvider.AddEventDic(DefaultClassName, SCNetGateWayGetCenterInfoCommand.DefaultClassName);

        gateWayProvider.Send("/gate/goto/getCenterInfo", System.Text.Encoding.Default.GetBytes(json), false);

    }
}
